#include "StdAfx.h"
#include "AnimationRotateMerryLift.h"
#define Pi std::atan(1.0)*4
CAnimationRotateMerryLift::CAnimationRotateMerryLift(void)
{
	m_time=0;
	m_dist=0.0;
}

CAnimationRotateMerryLift::~CAnimationRotateMerryLift(void)
{
}

void CAnimationRotateMerryLift::Update(){
	m_time++;
	m_time=m_time%180;
	double temp = m_node->GetY();
	m_dist=temp+cos(Pi*m_time/72.)/12;
	if(m_dist>8) m_dist=8;
	if(m_dist<-1) m_dist=-1;
	//else m_dist=temp-cos(Pi*m_time/72.);
	m_node->SetY(m_dist);
}

